<template>
	<view class="container">
		<image mode="widthFix" src="../../static/images/start.jpg"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: null
			}
		},
		
		onLoad() {
			
			const updateManager = uni.getUpdateManager()
			
			updateManager.onCheckForUpdate(function (res) {
			  // 请求完新版本信息的回调
			  console.log(res.hasUpdate)
			})
			
			updateManager.onUpdateReady(function (res) {
			  updateManager.applyUpdate()
			})
			
			updateManager.onUpdateFailed(function (res) {
			  // 新的版本下载失败
				console.log('新版本更新失败')
			})
			
			const that = this
			that.userInfo = uni.getStorageSync('userInfo')
			setTimeout(function() {
				if (that.userInfo) {
					if (that.userInfo.userType == 1) {
						uni.redirectTo({
							url: '/pages/group_chat_list/group_chat_list'
						})
					} else {
						uni.redirectTo({
							url: '/pages/teacher_group_chat_list/teacher_group_chat_list'
						})
					}
				} else {
					uni.redirectTo({
						url: '/pages/select_identity/select_identity'
					})
				}
			}, 1000)
			
		},
		
		methods: {
			
			
			
		}
	}
</script>

<style>
	.container {
		width: 750rpx;
	}
	
	.container image {
		width: 750rpx;
	}
</style>
